<!-- 历任离职人员-信息查看弹出框 -->
<template>
  <a-modal
    width="50%"
    v-model:visible="modalVisible"
    @ok="handleOk"
    @cancel="handleCancel"
    :mask-closable="false"
    draggable
    title-align="center"
  >
    <template #title>
      <div>信息查看</div>
    </template>
    <a-form :model="formData" auto-label-width>
      <a-form-item label="姓名" field="" show-colon>
        <a-input disabled></a-input>
      </a-form-item>
      <a-form-item label="担任职位" field="" show-colon>
        <a-input disabled></a-input>
      </a-form-item>
      <a-form-item label="任职时间" field="" show-colon>
        <a-range-picker disabled />
      </a-form-item>
      <a-form-item label="备注" field="" show-colon>
        <a-textarea
          disabled
          :auto-size="{
            minRows: 5
          }"
        ></a-textarea>
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script lang="ts" setup>
const props = withDefaults(
  defineProps<{
    visible: boolean; // 是否显示对话框
  }>(),
  {
    visible: false
  }
);

const emit = defineEmits(['update:visible']);

const modalVisible = computed({
  get() {
    return props.visible;
  },
  set(visible: boolean) {
    emit('update:visible', visible);
  }
});

watch(
  () => modalVisible.value,
  (newVal: boolean) => {
    if (newVal) {
      //
    }
  }
);

const formData: any = reactive({
  quitType: undefined,
  quitReason: undefined
});

const getData = () => {
  try {
    //
  } catch (error: unknown) {
    console.log(error);
  }
};

// 保存
const handleOk = () => {
  modalVisible.value = false;
};

// 取消
const handleCancel = () => {
  modalVisible.value = false;
};
</script>

<style scoped lang="less"></style>
